/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-19 11:44:02
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-22 12:51:02
 */
import 'package:flutter/material.dart';

class CustomBtn extends StatelessWidget {
  const CustomBtn({
    Key key,
    this.onTap,
    @required this.text,
    this.height = 60,
    this.width,
    this.boxShadows = const [],
    this.primary,
    this.style = const TextStyle(
      fontSize: 24,
      fontWeight: FontWeight.w500,
    ),
    this.radius = 30,
  }) : super(key: key);
  final VoidCallback onTap;
  final String text;
  final double height;
  final double width;
  final List<BoxShadow> boxShadows;
  final Color primary;
  final TextStyle style;
  final double radius;

  @override
  Widget build(BuildContext context) => Container(
        height: height,
        width: width ?? double.infinity,
        decoration: BoxDecoration(
          boxShadow: boxShadows,
        ),
        child: ClipRRect(
          borderRadius: BorderRadius.circular(radius),
          child: ElevatedButton(
            child: Text(
              text,
              style: style,
            ),
            style: ElevatedButton.styleFrom(
              primary: primary ?? Theme.of(context).primaryColor,
            ),
            onPressed: onTap,
          ),
        ),
      );
}
